import net.egork.collections.ReverseComparator;
import net.egork.utils.Solver;
import net.egork.utils.io.InputReader;

import java.io.PrintWriter;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
import java.util.Vector;

public class QBHEAP implements Solver {
    public void solve(int testNumber, InputReader in, PrintWriter out) {

        String s;
        PriorityQueue<Integer> q = new PriorityQueue<Integer>(15000,
                new ReverseComparator<Integer>());

        while (true) {
            try {
                s = in.readLine();
            } catch (Exception e) {
                //e.printStackTrace();
                s = "";
            }
            if (s.length() <= 0)
                break;
            if (s.charAt(0) == '+') {
                if (q.size() < 15000)
                    q.add(Integer.parseInt(s.substring(1)));
            } else if (s.charAt(0) == '-') {
                if (!q.isEmpty()) {
                    int i = q.peek();
                    while (!q.isEmpty() && q.peek() == i)
                        q.poll();
                }
            } else
                break;
        }

        Set<Integer> set = new HashSet<Integer>();
        set.addAll(q);

        int n = set.size();
        int v[] = new int[n];
        int j = 0;
        for (int i : set)
            v[j++] = i;

        out.println(n);
        while (--j >= 0)
            out.println(v[j]);
    }
}

